/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Universidad del Pais Vasco
 * License Type: Academic
 */
package orm;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class RecursoDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression id;
	public final StringExpression titulo;
	public final StringExpression autor;
	public final StringExpression materia;
	public final StringExpression isbn;
	
	public RecursoDetachedCriteria() {
		super(orm.Recurso.class, orm.RecursoCriteria.class);
		id = new IntegerExpression("id", this.getDetachedCriteria());
		titulo = new StringExpression("titulo", this.getDetachedCriteria());
		autor = new StringExpression("autor", this.getDetachedCriteria());
		materia = new StringExpression("materia", this.getDetachedCriteria());
		isbn = new StringExpression("isbn", this.getDetachedCriteria());
	}
	
	public RecursoDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, orm.RecursoCriteria.class);
		id = new IntegerExpression("id", this.getDetachedCriteria());
		titulo = new StringExpression("titulo", this.getDetachedCriteria());
		autor = new StringExpression("autor", this.getDetachedCriteria());
		materia = new StringExpression("materia", this.getDetachedCriteria());
		isbn = new StringExpression("isbn", this.getDetachedCriteria());
	}
	
	public Recurso uniqueRecurso(PersistentSession session) {
		return (Recurso) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Recurso[] listRecurso(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Recurso[]) list.toArray(new Recurso[list.size()]);
	}
}

